package com.night.icm.persistence.business.reporsitory;

import com.night.icm.persistence.business.entity.StudentCourseGrade;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * StudentCourseGradeRepository
 *
 * @author Liao ZhiYong
 * @date 2020/2/5
 */
@Repository
public interface StudentCourseGradeRepository extends JpaRepository<StudentCourseGrade, Long>, JpaSpecificationExecutor<StudentCourseGrade> {

    /**
     * 根据学生选课id删除学生课程成绩
     *
     * @param id 学生选课id
     */
    void deleteByStudentCourseId(Long id);

    /**
     * 通过课程汇总id查询所有汇总详细
     * @param id 课程汇总id
     * @return 汇总详细
     */
    List<StudentCourseGrade> findByStudentCourseGradeGatherId(Long id);
}
